package cn.yunhe.controller;

import cn.yunhe.model.UserNumber;
import cn.yunhe.service.impl.UserNumberServiceImpl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/free")
public class FreeController {
    @Resource
    private UserNumberServiceImpl userNumberService;

    @RequestMapping("/index")
    public ModelAndView test(){
        ModelAndView mv = new ModelAndView();
        List<UserNumber> list = userNumberService.getLikeUserNumbers();
        mv.addObject("list",list);
        mv.setViewName("index");
        return mv;
    }
    @RequestMapping("/login")
    public ModelAndView login(){
        ModelAndView mv = new ModelAndView();
        mv.setViewName("login");
        return mv;
    }

    public UserNumberServiceImpl getUserNumberService() {
        return userNumberService;
    }

    public void setUserNumberService(UserNumberServiceImpl userNumberService) {
        this.userNumberService = userNumberService;
    }
}
